#include<iostream>
#include<cmath>
using namespace std;
long long Gong(long long y,long long b)
{
	if(y<b)
	{
		long long t;
		t=y;
		y=b;
		b=t;
	}
	while(y%b!=0)
	{
		long long t=b;
		b=y%b;
		y=t;
	}
	return b;
}
void Sum(long long &x,long long &y,long long a,long long b)
{
	long long G=Gong(y,b);
	x=x*b*G+a*y*G;
	y=G*y*b;
    if(x!=0&&y!=0) 
    {
    	long long g=Gong(abs(x),abs(y));
        x=x/g;
	    y=y/g;
	}
}
int main()
{
	long long a,b;
	long long x,y;
	int N;
	cin>>N;
	for(int i=0;i<N;i++)
	{
		if(i==0)
		scanf("%lld/%lld",&x,&y);
		else 
		{
			scanf("%lld/%lld",&a,&b);
			Sum(x,y,a,b);
		}		
	}
	if(y==1||x==0)
	{
		cout<<x<<endl;
		return 0;
	}
    if(abs(x)>y)
    {
    	cout<<x/y<<' '<<x%y<<'/'<<y<<endl;
	}
	else
	cout<<x<<'/'<<y<<endl;
	return 0;
}
